package top.tsyz.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(description = "Product 实体类")
public class Product {

    @ApiModelProperty(value = "商品ID")
    private Long id;

    @ApiModelProperty(value = "分类ID")
    private Long categoryId;

    @ApiModelProperty(value = "品牌ID")
    private Long brandId;

    @ApiModelProperty(value = "商品名称")
    @NotBlank(message = "商品名称不能为空")
    @Size(max = 200, message = "商品名称长度不能超过200个字符")
    private String name;

    @ApiModelProperty(value = "商品副标题")
    @Size(max = 255, message = "商品副标题长度不能超过255个字符")
    private String subtitle;

    @ApiModelProperty(value = "商品主图")
    @Size(max = 255, message = "商品主图长度不能超过255个字符")
    private String mainImage;

    @ApiModelProperty(value = "商品子图")
    @Size(max = 65535, message = "商品子图长度不能超过65535个字符")
    private String subImages;

    @ApiModelProperty(value = "商品详情")
    @Size(max = 65535, message = "商品详情长度不能超过65535个字符")
    private String detail;

    @ApiModelProperty(value = "商品价格")
    private BigDecimal price;

    @ApiModelProperty(value = "库存数量")
    private Integer stock;

    @ApiModelProperty(value = "状态 0-下架 1-上架")
    private Boolean status;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "创建人")
    @Size(max = 50, message = "创建人长度不能超过50个字符")
    private String createUser;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    @ApiModelProperty(value = "更新人")
    @Size(max = 50, message = "更新人长度不能超过50个字符")
    private String updateUser;

    @ApiModelProperty(value = "逻辑删除 0-未删除 1-已删除")
    private Boolean isDeleted;

}
